home *** CD-ROM | disk | FTP | other *** search
/ CD World Haziran 1997 / CD World Haziran 1997.iso / Programlama ve Gelistirme / DTime / _SETUP.1 / Dtime.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-04  |  2.2 KB  |  85 lines

  1. /*
  2. Module : DTIME.cpp
  3. Purpose: Defines the initialization routines for the DLL.
  4. Created: PJN / DATE/1 / 22-02-1996
  5. History: None
  6.  
  7. Copyright (c) 1995 by PJ Naughter.  
  8. All rights reserved.
  9.  
  10. */
  11.  
  12. /////////////////////////////////  Includes  //////////////////////////////////
  13. #include "stdafx.h"  
  14. #include <memory.h>
  15. #include "dtime.h"
  16. #include <afxdllx.h>
  17.  
  18.  
  19.  
  20. ///////////////////////////////// Locals //////////////////////////////////////
  21. #ifdef _WINDOWS
  22. static AFX_EXTENSION_MODULE DtimeDLL = { NULL, NULL };
  23. #endif
  24.  
  25.  
  26. /////////////////////////////////  Macros  ////////////////////////////////////
  27. #ifdef _DEBUG
  28. #define new DEBUG_NEW
  29. #undef THIS_FILE
  30. static char THIS_FILE[] = __FILE__;
  31. #endif         
  32.  
  33.  
  34.  
  35. /////////////////////////////// Implementation ////////////////////////////////
  36. extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  37. {
  38.   if (dwReason == DLL_PROCESS_ATTACH)
  39.   {
  40.     TRACE0("DTIME Extension DLL Initializing\n");
  41.  
  42.     // Extension DLL one-time initialization
  43.     AfxInitExtensionModule(DtimeDLL, hInstance);
  44.  
  45.     // Insert this DLL into the resource chain
  46.     new CDynLinkLibrary(DtimeDLL);
  47.  
  48.     //Display some TRACE statements about the version of the DTime dll
  49.     WORD wDTimeVer = ::GetDTimeVersion();
  50.     CString sVer;
  51.     sVer.Format(CString("%d.%02d"), HIBYTE(wDTimeVer), LOBYTE(wDTimeVer));
  52.  
  53.     #ifdef _UNICODE
  54.     TRACE1("(32 bit Unicode Debug Build) Version: %s (C) PJ Naughter 1996\n", sVer);
  55.     #else
  56.     TRACE1("(32 bit Ascii Debug Build) Version: %s (C) PJ Naughter 1996\n", sVer);
  57.     #endif
  58.   }
  59.   else if (dwReason == DLL_PROCESS_DETACH)
  60.     TRACE0("DTIME Extension DLL Terminating\n");
  61.  
  62.   return 1;   // ok
  63. }
  64.  
  65. WORD GetDTimeVersion()
  66. {
  67.   return 0x0200;       //v1.0   Original Release
  68.  
  69.                        //v1.1   Port to Win16, Dos
  70.  
  71.                        //v1.11  Minor tweaks, Translation to German
  72.  
  73.                        //v2.0   UI Enhancements, Close Integration with Win32 NLSAPI,
  74.                        //       Dropped support for DOS, Win16 and Win32s,
  75.                        //       Numerous bug fixes to underlying classes
  76. }
  77.  
  78. void AboutDTime()
  79. {
  80.   CDTimeReminderDlg dlg;
  81.   dlg.DoModal();
  82. }
  83.  
  84.  
  85.